g05eyf
g05eyf
© Numerical Algorithms Group, 2002.
Purpose
G05EYF Pseudo-random integer from reference vector
Synopsis
[fun_value] = g05eyf(r)
Description
This routine is designed for use in conjunction with other
routines in this chapter, which set up the reference vector R for
specific distributions or according to a distribution specified
in terms of the PDF (probability density function) or CDF
(cumulative distribution function). See the G05 Chapter
Introduction.
The routine generates a random number x from G05CAF and searches
the CDF in R for the smallest value y such that CDF(y)>=x and CDF
(y-1)<x. R will contain an index to speed this process and the
more space allotted to R the faster this will become.
Parameters
g05eyf
Required Input Arguments:
r (:) real